/**
 * @param {number} x
 * @param {number} y
 * @return {number}
 */
var hammingDistance = function(x, y) {
  let z = x ^ y, count = 0;
  while(z) {
    if(z % 2 === 1)
      count++;
    z = Math.floor(z / 2);
  }
  return count;
};
